-- 基础信息
local base_info = {
	group_id = 133314326
}

--================================================================
-- 
-- 配置
-- 
--================================================================

-- 怪物
monsters = {
	{ config_id = 326001, monster_id = 21010201, pos = { x = -1113.422, y = 120.037, z = 4821.526 }, rot = { x = 0.000, y = 81.595, z = 0.000 }, level = 32, drop_tag = "丘丘人", disableWander = true, area_id = 32 },
	{ config_id = 326004, monster_id = 21020201, pos = { x = -1118.211, y = 119.834, z = 4812.042 }, rot = { x = 0.000, y = 298.487, z = 0.000 }, level = 32, drop_tag = "丘丘暴徒", pose_id = 401, area_id = 32 },
	{ config_id = 326005, monster_id = 21030101, pos = { x = -1110.501, y = 120.948, z = 4827.149 }, rot = { x = 0.000, y = 177.572, z = 0.000 }, level = 32, drop_tag = "丘丘萨满", pose_id = 9012, area_id = 32 },
	{ config_id = 326007, monster_id = 26090801, pos = { x = -1110.339, y = 121.527, z = 4822.573 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 32, drop_tag = "蕈兽", pose_id = 104, area_id = 32 }
}

-- NPC
npcs = {
}

-- 装置
gadgets = {
	{ config_id = 326002, gadget_id = 70211002, pos = { x = -1115.742, y = 125.881, z = 4811.825 }, rot = { x = 13.391, y = 300.519, z = 358.633 }, level = 26, drop_tag = "战斗低级须弥", state = GadgetState.ChestLocked, isOneoff = true, persistent = true, explore = { name = "chest", exp = 10 }, area_id = 32 },
	{ config_id = 326006, gadget_id = 70710221, pos = { x = -1110.428, y = 121.476, z = 4822.628 }, rot = { x = 7.751, y = 209.272, z = 333.947 }, level = 32, area_id = 32 }
}

-- 区域
regions = {
}

-- 触发器
triggers = {
	{ config_id = 1326003, name = "ANY_MONSTER_DIE_326003", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_326003", action = "action_EVENT_ANY_MONSTER_DIE_326003" }
}

-- 变量
variables = {
}

--================================================================
-- 
-- 初始化配置
-- 
--================================================================

-- 初始化时创建
init_config = {
	suite = 1,
	end_suite = 0,
	rand_suite = false
}

--================================================================
-- 
-- 小组配置
-- 
--================================================================

suites = {
	{
		-- suite_id = 1,
		-- description = ,
		monsters = { 326001, 326004, 326005, 326007 },
		gadgets = { 326002, 326006 },
		regions = { },
		triggers = { "ANY_MONSTER_DIE_326003" },
		rand_weight = 100
	}
}

--================================================================
-- 
-- 触发器
-- 
--================================================================

-- 触发条件
function condition_EVENT_ANY_MONSTER_DIE_326003(context, evt)
	-- 判断剩余怪物数量是否是0
	if ScriptLib.GetGroupMonsterCount(context) ~= 0 then
		return false
	end
	
	return true
end

-- 触发操作
function action_EVENT_ANY_MONSTER_DIE_326003(context, evt)
	-- 将configid为 326002 的物件更改为状态 GadgetState.Default
	if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 326002, GadgetState.Default) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
			return -1
		end 
	
	-- 运营数据埋点，匹配LD定义的规则使用
	    if 0 ~= ScriptLib.MarkPlayerAction(context, 4000, 3, 1) then
	      ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : mark_playerAction")
	      return -1
	    end
	
	return 0
end